package en.edu.cuit.aumalls.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import cn.edu.cuit.aumalls.entity.CartGoods;
import cn.edu.cuit.aumalls.entity.Goods;

public interface CartgoodsMapper {
	
	@Select("select * from cartgoods")
	List<CartGoods> findAll();

	@Delete("delete from cartgoods where goods_id = #{goods_id}")
	void deleteOneByGoodsId(@Param("goods_id") int goods_id);

	@Insert("Insert into cartgoods values(default,#{goods_name},#{goods_duty},#{goods_price},#{real_price},#{num},#{total_price})")
	void addGoods(@Param("goods_name")String goods_name,@Param("goods_duty")float goods_duty,
			@Param("goods_price")float goods_price,@Param("real_price")float real_price,
			@Param("num")int num,@Param("total_price")float total_price);
}
